# stddev Makefile
# Description: This makefile descends into src and finds the source files it
# knows how to do and compiles.
#
# Additional targets from what is typically are supported in order to ease
# the automatic generation of documentation, unit tests, and the running
# of those unit tests.
#
# I'm borrowing a feature from MSCV to have a directory of scripts that are to
# be executed in a post-build step. These can be created by the user and are
# limited only by the skills and permissions of the particular user account.
#
# stddev is not responsible for the failure or success of any particular post-
# build script.

# Some variables. Customize these to fit the project. They typically should
# at least work correctly, but may need additional work. This makefile uses
# most of the default make variables.

CSRC = $(wildcard *.c)
CXXSRC = $(wildcard *.cpp)
HEADERS = $(wildcard *.h)

COBJECTS = $(CSRC:%.c=%.o)
CXXOBJECTS = $(CXXSRC:%.cpp=%.o)

default: target 

%.o: src/%.c

target: post_build $(COBJECTS) $(CXXOBJECTS)

# Executes any post-build scripts if there are any, but will not fail
# if there are zero so make doesn't return an error when there's still
# a sucessful build.
post_build:

.PHONY : clean
clean:
	-@$(RM) *.o
